package com.patterns.java.decorator;

/**
 * 启动类
 *
 * @author 三多
 * @Time 2021/10/12
 */
public class DecoratorPatternDemo {
    public static void main(String[] args) {
        TextView textView = new TextView();
        textView.show();
        System.out.println("----------------纯文本-------------------");
        ViewDecorator blackViewText = new BlackBarViewDecorator(textView);
        blackViewText.show();
        System.out.println("-----------------添加黑色边框------------------");
        ViewDecorator scrollBarViewText = new ScrollBarViewDecorator(textView);
        scrollBarViewText.show();
        System.out.println("--------------添加滚动条---------------------");
        ViewDecorator blackAndScrollBarViewText = new ScrollBarViewDecorator(blackViewText);
        blackAndScrollBarViewText.show();
        System.out.println("--------------添加黑色边框+滚动条---------------------");
    }

}
